﻿using System;
using GeoAPI.Geometries;
using YJKGridTopologyCal.Triangulate.QuadEdge;

namespace YJKGridTopologyCal.Triangulate
{
	public class ConstraintVertex : Vertex
	{
		public ConstraintVertex(Coordinate p) : base(p)
		{
		}

		public bool IsOnConstraint
		{
			get
			{
				return this.isOnConstraint;
			}
			set
			{
				this.isOnConstraint = value;
			}
		}

		public object Constraint
		{
			get
			{
				return this.constraint;
			}
			set
			{
				this.isOnConstraint = true;
				this.constraint = value;
			}
		}

		protected internal void Merge(ConstraintVertex other)
		{
			if (other.isOnConstraint)
			{
				this.isOnConstraint = true;
				this.constraint = other.constraint;
			}
		}

		private bool isOnConstraint;

		private object constraint;
	}
}
